<%--
  Created by IntelliJ IDEA.
  User: 86185
  Date: 2024/6/21
  Time: 14:48
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
    <title>vue购物车地址订单详情代码 - 站长素材</title>

    <!--css类引用-->
    <link rel="stylesheet" href="user/plugins/bootstrap/bootstrap.min.css" />
    <link rel="stylesheet" href="user/plugins/layui/css/layui.css" />
    <link rel="stylesheet" href="user/plugins/awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" href="user/plugins/eleme-ui/index.css" />
    <link rel="stylesheet" href="css/CivilMilitaryIntegration/public.css" />
    <link rel="stylesheet" href="user/css/CivilMilitaryIntegration/ShoppingCartAdress.css" />

    <style type="text/css">
        #address1:hover {
            background-color: #05226c;
            color: white;
        }
        #address2 {
            display: none;
            z-index: 9999;
            width: 400px;
            height: 450px;
            background-color: whitesmoke;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -150%);
            font-size: 18px;
            padding: 30px 25px;
            text-align: right;
            border: white 2px solid;
            line-height: 25px;
        }
        .address2 {
            font-size: 12px;
            width: 250px;
        }
    </style>
</head>
<body>
<!--toper 公用-->

<!--主要内容-->
<div class="row" id="myVue"  v-cloak>
    <div class="col-lg-10 col-lg-offset-1" ><br>
        <div class="contenter">
            <ul>
                <li>
                    <el-row>
                        <span class="addAddressCons">收货人信息</span>
                        <span class="addAddress" onclick="addAddress()">新增收货地址</span>
                    </el-row>
                    <div class="scolleShow" >
                        <el-row  class="consignee">
                            <c:forEach items="${allAddress}" var="address" varStatus="status">
                                <el-col :span='4'>
                                    <a href="UpdateAddressFirstServlet?id=${address.id}">
                                        <div class="consigneeList consigneeListWidth">
                                            <span>${address.conName}</span>
                                        </div>
                                    </a>
                                </el-col>
                                <el-col id="address1" class='rightAddress'  :span='20'>
                                    <span>${address.postalCode}</span>
                                    <span>${address.address}</span>
                                    <span>${address.conPhone}</span>
                                    <a href="DeleteAddressServlet?id=${address.id}">删除</a>
                                    <div class='edmitAddre' >
                                        <span class='edmitSpan' onclick="updateAddress('${address.id}', '${address.conName}', '${address.address}', '${address.postalCode}', '${address.conPhone}')">编辑</span>
                                    </div>
                                </el-col>
                                <hr>
                            </c:forEach>
                        </el-row>
                    </div>
                    <div id="address2">
                        <form action="AddAddressServlet" method="get">
                            <input class="address2" name="id" id="id0" type="hidden">
                            <input class="address2" name="type" id="type" type="hidden">
                            <span>收货人：</span>
                            <input class="address2" name="conName" id="name0" type="text">
                            <br><br>
                            <span>邮政编码：</span>
                            <input class="address2" name="postalCode" id="post0" type="text">
                            <br><br>
                            <span>详细地址：</span>
                            <input class="address2" name="address" id="address0" type="text">
                            <br><br>
                            <span>手机号：</span>
                            <input class="address2" name="conPhone" id="phone0" type="text">
                            <br><br>
                            <a id="cancel" onclick="cancelAdd()" style="border: #01AAED 2px solid; background-color: #01AAED; border-radius: 5px">取消</a>
                            <button type="submit" id="add" style="border: #01AAED 2px solid; background-color: #01AAED; border-radius: 5px">新增</button>
                        </form>
                    </div>
                    <script>
                        //编辑收货地址函数
                        function updateAddress(id, conName, address, postalCode, conPhone){
                            console.log("123 : ", conPhone)
                            document.getElementById("address2").style.display = "block";
                            document.getElementById("id0").value = id;
                            document.getElementById("name0").value = conName;
                            document.getElementById("address0").value = address;
                            document.getElementById("post0").value = postalCode;
                            document.getElementById("phone0").value = conPhone;
                            document.getElementById("type").value = 1;
                            document.getElementById("add").innerText = "修改";
                        }

                        function addAddress(){
                            document.getElementById("address2").style.display = "block";
                            document.getElementById("type").value = 0;
                            document.getElementById("add").innerText = "添加";
                        }

                        function cancelAdd(){
                            document.getElementById("address2").style.display = "none";
                        }
                    </script>
                </li>
                <li>
                    <span class="addAddressCons">送货清单</span>
                    <span class="addAddress"><a href="GetCartServlet">返回修改购物车</a></span>
                    <div class="row deliverymode">
                        <div class="col-lg-12 deliverymodeRight" >
                            <div class="layui-form">
                                <table class="layui-table">
                                    <c:forEach items="${carts}" var="cart" varStatus="status">
                                        <tr>
                                            <td>
										<span class="goodName">
											<img class="goodImg" src="${cart.goodsImageUrl}" />
										</span>
                                                <span class="goodName goodsName">
											<h2 class="goodname"></h2>
											<p class="goodGary">
												<span>商品名：</span>
												<span>${cart.goodsName}</span>
											</p>
											<p class="goodGary">
												<span>购买数量：</span>
												<span>${cart.goodsCount}</span>
											</p>
										</span>
                                            </td>
                                            <td class="goodPrice">单价：$ ${cart.goodsPrice}</td>
                                            <td class="goodPrice">共：$ ${cart.goodsPrice * cart.goodsCount}</td>
                                        </tr>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div class="row footerRow">
            <span class="footerRowprice">应付金额：<span>￥9999.00</span></span>
            <span class="footerRowaddress"><span>商品收获地址：${allAddress[0].address}</span></span>
        </div>
        <a class="btn submitForm" href="AddOrderServlet">提交订单</a>
    </div>


</div>

<!--js类引用-->
<script type="text/javascript" src="user/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="user/plugins/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="user/plugins/vue/vue.js"></script>
<script type="text/javascript" src="user/plugins/eleme-ui/index.js"></script>
<script type="text/javascript" src="user/js/CivilMilitaryIntegration/ShoppingCart.js"></script>
<!--<script type="text/javascript" src="js/CivilMilitaryIntegration/abc.js" ></script>-->

<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
    <p>适用浏览器：360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p>
    <p>来源：<a href="http://sc.chinaz.com/" target="_blank">站长素材</a></p>
</div>
</body>
</html>
